# List
# create
a = ['a'] * 3
a.append('a')
a.insert(0, 'b')
a += 'c'
print(a)

# retrieve
print(a.index('a'))
print(a[1:4])


# update
a[1:4] = ['it']
print(a)

# delete
a.pop()
a.remove('a')
print(a)

# count
a += 'z', 'b', 'r'
print(a.count('b'))
print(a)
a.reverse()
print(a)
print(sorted(a))


# Tuple
# retrieve
b = (1, 2, 3, 5, 4)
print(b.index(4))
print(b[:3])


# Dict
# create
c = {'x': 7, 'y': 77}
c['z'] = 777
print(c)
c1 = {'t': 8}
c.update(c1)
c.setdefault('o', 88)

# retrieve
print(c['y'])
print(c.keys())
print(c.items())
print(c.get('w', 44))
print(c.get('o', 44))

# update
c['o'] = 888

# delete
c.pop('y')
print(c)
c.clear()


# Set
# create
a = {1, 2}
a.add(4)
print(a)

# retrieve
print(2 in a)

# update
d = {3, 4}
a.update(d)
print(a)

# delete
a.pop()
a.pop()
print(a)
a.discard(3)
print(a)
